package com.test.display;

import android.app.Activity;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.widget.TextView;

import com.test.R;

public class Display extends Activity {
    /** Called when the activity is first created. */
	
	private TextView tv_height;
	private TextView tv_width;
	private TextView tv_desity;
	private TextView tv_desitydpi;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.displaymetris);
        findView();
    }
    
    void findView(){
    	tv_height = (TextView) findViewById(R.id.height);
    	tv_width = (TextView) findViewById(R.id.width);
    	tv_desity = (TextView) findViewById(R.id.desity);
    	tv_desitydpi = (TextView) findViewById(R.id.desitydpi);
    	DisplayMetrics dm = new DisplayMetrics();
         getWindowManager().getDefaultDisplay().getMetrics(dm);
         int nowHeight = dm.heightPixels;
         int nowWidth = dm.widthPixels;
         int nowDesity = dm.densityDpi;
         float nowDesity2 = dm.density;
         tv_height.setText("" + nowHeight);
         tv_width.setText("" + nowWidth);
         tv_desity.setText("" + nowDesity);
         tv_desitydpi.setText("" + nowDesity2);
    }
}